﻿using Android;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Text.Method;
using AndroidX.Core.App;
using 交互音乐播放器.中间件;
using Environment = Android.OS.Environment;

namespace InteractiveMusicPlayerMobile;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
    public static MainActivity 运行时 { get; set; }
    public MainActivity()
    {

        System.Diagnostics.Debug.WriteLine("已启动运行时");
        运行时 = this;
    }

    public void 打开授权所有文件夹管理权限窗口()
    {

        if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.R)
        {
            if (!Android.Provider.Settings.CanDrawOverlays(this))
            {
                var intent = new Android.Content.Intent(Android.Provider.Settings.ActionManageAllFilesAccessPermission);
                StartActivity(intent);
            }
        }
     
    }

    protected override void OnCreate(Bundle savedInstanceState)
    {
        //底栏透明
        //Window.SetFlags(Android.Views.WindowManagerFlags.TranslucentNavigation, Android.Views.WindowManagerFlags.DrawsSystemBarBackgrounds);
        //导航栏颜色定义
        Window.SetStatusBarColor(Android.Graphics.Color.Argb(255,69, 74,168));
        Window.SetNavigationBarColor(Android.Graphics.Color.Argb(255, 69, 74, 168));
      

        base.OnCreate(savedInstanceState);

    }

   
}
